package com.xnyzc.lhy.statistics.eenum;

import com.xnyzc.lhy.common.exception.PangException;
import com.xnyzc.lhy.common.penum.EErrorCode;
import com.xnyzc.lhy.common.util.CheckUtil;

/**
 * 订单看板
 *
 * @author cuixiaojian
 */
public enum EOrderChart {

    /**
     * enum
     */
    ORDER_FLOW(1, "今日订单流水"),
    PASSENGER_INVOICE(2, "今日乘客发单量"),
    ANSWER_ORDER(3, "今日应答订单量"),
    ORDER_FULFILLMENT(4, "今日完成订单量"),
    ENQUIRY(5, "今日询价乘客量"),
    PRIOR_OTHER_ACCEPTANCE(6, "应答前乘客其他平台受理订单量"),
    AFTER_OTHER_ACCEPTANCE(7, "应答后其他平台受理订单量"),
    DISPATCHING_TIMEOUT(8, "调度超时订单量"),
    AFTER_CANCELLATION(9, "应答前乘客取消量"),
    AFTER_DRIVER_CANCEL(10, "应答后司机取消订单量"),
    REAR_PASSENGER_CANCELLATION(11, "应答后乘客取消订单量"),
    SERVICE_CANCELLATION(12, "客服取消订单量"),
    IN_PERFROMANCE(13, "履行中订单量"),
    TO_BE_PAID(14, "待支付订单量"),
    PAID_PASSENGER_CANCELLATION(15, "已支付订单量");

    private Integer key;
    private String value;

    EOrderChart(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String value(Integer key) {
        if (CheckUtil.objIsNotEmpty(key)) {
            for (ECapacityOption examine : ECapacityOption.values()) {
                if (key.equals(examine.getKey())) {
                    return examine.getValue();
                }
            }
        }
        throw PangException.create(EErrorCode.noData);
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
